home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume4 / uumail3 / part1 next >
Encoding:
Internet Message Format  |  1986-11-30  |  41.3 KB

  1. From: soma!sob
  2. Newsgroups: mod.sources
  3. Subject: uumail 3.0 (Part 1 of 2)
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 4, Issue 91
  7. Submitted by: soma!sob
  8.  
  9. #! /bin/sh
  10. # This is a shell archive, meaning:
  11. # 1. Remove everything above the #! /bin/sh line.
  12. # 2. Save the resulting text in a file.
  13. # 3. Execute the file with /bin/sh (not csh) to create the files:
  14. #    README
  15. #    domains
  16. #    palias
  17. #    rmail.c
  18. #    address.c
  19. #    makefile
  20. #    uux.c
  21. #    uumail.1
  22. #    opath.3
  23. #    address.1
  24. #    Alias.Design
  25. #    Sendmail
  26. #    Binary.Only
  27. # This archive created: Fri May  2 17:48:10 1986
  28. export PATH; PATH=/bin:$PATH
  29. echo shar: extracting "'README'" '(8177 characters)'
  30. if test -f 'README'
  31. then
  32.     echo shar: will not over-write existing file "'README'"
  33. else
  34. cat << \SHAR_EOF > 'README'
  35. This is an updated version of uumail (and uupath) that can 
  36. access a pathalias-generated database to facilitate routine mail.
  37.  
  38. These program can cope with DBM and standard line-oriented forms of 
  39. pathalias-generated databases.
  40.  
  41. This version of uumail can be used as uupath by linking uumail to
  42. uupath. Also, this version can handle domain addresses (user@host.domain).
  43. You can put as many addresses on a line as you like.
  44.  
  45. This version provides an alias and forwarding facility. For details on 
  46. aliasing see the file "Alias.Design". The forward facility is similiar to
  47. the one in sendmail. A user may forward his mail by adding a file called
  48. ".forward" in his home directory. This file conatains the address(es) to which
  49. mail is to be forwarded. These addresses are not reprocessed by the aliasing
  50. subroutine, but may be in domain format (if the -DOPATH flag is used when
  51. compiling and the /usr/lib/uucp/domains file is correctly configured).
  52.  
  53. There is also some experimental sections in this release that binary only
  54. sites might like to experiment with. See the file "Binary.Only" for details on
  55. this experiment.
  56.  
  57. There has been some confusion in the past on configuring uumail to work
  58. with sendmail. See the file "Sendmail" for information on this.
  59.  
  60.  *    IF YOU ARE USING A DBM DATABASE, READ THIS!
  61.  *    If the special sentinel value of @@@ is not present in the
  62.  *    database, then getpath will assumed that the database is being
  63.  *    rebuilt and will block for TIMEOUT (default = 180) seconds.  
  64.  *    If, after 5 such blocks, the sentinel is not present,
  65.  *    the error code EX_TEMPFAIL is returned.
  66.  *    The same is true if the dbm files cannot be initialized.
  67.  *    Please be sure to add the sentinal to the DBM database when
  68.  *    it is created.
  69.  *    To add the sentinel, use the "makedb" command.
  70.  *    makedb -a dbrootname < @@@
  71.  *    should append the sentinel to the database.
  72.  
  73. There are some compile flags to be aware of when making uumail.
  74. When defining these, place them on the OPTIONS line in the makefile.
  75. Here is a list of them.
  76.  
  77. DEBUG compiles in the debugging code.
  78. OPATH causes the opath subroutine to be used to resolve addresses.
  79. If you do not use this flag, you cannot use the user@host.domain style
  80. addresses with uumail.
  81. DBM causes uumail to use the DBM format patalias database. If you do not
  82. have the dbm libraries, do not use this flag.
  83. SYSIII will make adjustments for system that are derived from UNIX System
  84. III or System V.
  85. NOGRADE should be used if your uux does not understand the -g flag.
  86. NORETURN should be used if your uux does not understand the -a flag.
  87. LOG will enable logging of uumail traffic (be sure that the file
  88. you specify in uuconf.h is world writable or this option will not work).
  89. UGLYUUCP causes the From_ line produced by uumail to contain the
  90. "remote from hostname" string. This is usually necessary for reliable
  91. use of uumail especially on SYSV and V7 machines.
  92. GETHOSTNAME will cause the system call gethostname to be used. If you
  93. are a BSD site, define this.
  94. SYSTEMNAME will cause the systemname to be derived from the file
  95. /usr/lib/uucp/SYSTEMNAME. This should be defined if your machine
  96. is a Sperry 5000.
  97. SORTED will cause the non-DBM database to be searched fasted, BUT
  98. it assumes that this database is SORTED. If you do not sort your
  99. database, do not define this.
  100. NOALIAS will not compile in the Aliasing and Forward facilities.
  101. You probably want to define this if you are running sendmail or some
  102. other mailer that already does this.
  103. OPIMIZE will attempt to send mail by a "more optimal" path. This
  104. is experimental.
  105. RFC976 will cause uumail to behave as a CLASS 3 mailer as defined in 
  106. RFC976. Defining this flag may cause your mail to behave differently
  107. than it has in the past (particularly if you are a UUCP-only site). Please
  108. be sure to read the RFC carefully to understand the differences between
  109. the different class of mailers. See more on this below.
  110.  
  111. There are some other items that should be noted when configuring uumail.
  112. In the makefile, set UUMAIL equal to the location of the uumail program
  113. on your system FOLLOWING INSTALLATION! Set REALUUX equal to the location
  114. of the uux program. This will be /usr/bin/uux on most systems. Binary
  115. only site should check the "Binary.Only" file for more information on
  116. the use of this symbol. BINDIR should be set to the directory you want
  117. the address and uupath program to go, usually /usr/ucb, /usr/local, or
  118. /usr/lbin.
  119.  
  120. If you want to install this system, use "make install". If you want
  121. to have it do all the work for incoming mail, type "make mailer". You
  122. probably do not want to "make mailer" if you run sendmail.
  123.  
  124. A manual page for address, opath, uumail and uupath are included.
  125.  
  126.  
  127. RFC976 Compliance notes
  128.  
  129. Uumail is capable of satisfying Class 3 requirements as specified in
  130. RFC976. It can also be compiled to satisfy Class 2 and Class 1 requirements
  131. only. Here are the appropriate compile time flags for compliance with
  132. with the three classes; these are only the flags necessary to make 
  133. uumail perform in a particular class. Other flags may be needed to use
  134. the dbm-type database and other options. It should be noted that each
  135. higher numbered class is a superset of the lower numbered class,
  136. so if you are a class 3 you will automatically comply with Classes 1
  137. and 2. The following is excerpted from the RFC976 document.
  138.  
  139.  
  140.    Class 1   old-style UUCP ! routing only.  We assume that the host
  141.              understands local user names:
  142.  
  143.                   rmail user
  144.  
  145.              and bang paths
  146.  
  147.                   rmail host1!host2!user
  148.  
  149.              but we assume nothing more about the host.  If we have
  150.              no information about a host, we can treat it as class 1
  151.              with no problems, since we make no assumptions about
  152.              how it will handle hybrid addresses.
  153.  
  154. COMPILE FLAGS NEED FOR THIS CLASS: UGLYUUCP
  155.  
  156.  
  157.  
  158.    Class 2   Old style UUCP ! routing, and 4.2BSD style domain
  159.              parsing.  We assume the capabilities of class 1, plus
  160.              the ability to understand
  161.  
  162.                   rmail user@domain
  163.  
  164.              if the "domain" is one outside the UUCP zone which
  165.              the host knows about.  Class 2 hosts do not necessarily
  166.              understand domain!user or have routers.  Hosts in non-
  167.  
  168.              UUCP RFC-920 domains are considered class 2, even though
  169.              they may not understand host!user.
  170.  
  171. COMPILE FLAGS NEED FOR THIS CLASS: OPATH UGLYUUCP
  172.  
  173.    Class 3   All class 1 and 2 features are present.  In addition,
  174.              class 3 hosts must be able to route UUCP mail for hosts
  175.              that are not immediately adjacent and also understand
  176.              the syntax
  177.  
  178.                   rmail domain!user
  179.  
  180.              as described above.  All gateways into UUCP must be
  181.              class 3.
  182.  
  183. COMPILE FLAGS NEED FOR THIS CLASS: OPATH UGLYUUCP RFC976
  184.  
  185. One final note: Uumail does not use the Algorithm specified in RFC976
  186. to perform its work. That algorithm is likely to be a part of
  187. the Batch SMTP program referred to in the RFC.
  188.  
  189. Please forward comments and bug fixes to me at sob@rice.edu or 
  190. ihnp4!shell!soma!sob or seismo!drillsys!sob or sdcsvax!drillsys!sob.
  191.  
  192. Stan Barber
  193. Baylor College of Medicine
  194. Houston, Texas
  195.  
  196. P.S. My thanks to all those who reported bugs from the previous release.
  197. Please continue to send them in, and I will try to keep fixing them.
  198.  
  199.  
  200. ***************************************************************************
  201. This work in its current form is Copyright 1986 Stan Barber
  202. with the exception of opath, gethostname and the original getpath which
  203. as far as I know are in the Public Domain. This software may be distributed
  204. freely as long as no profit is made from such distribution and this notice
  205. is reproducted in whole.
  206. ***************************************************************************
  207. This software is provided on an "as is" basis with no guarantee of 
  208. usefulness or correctness of operation for any purpose, intended or
  209. otherwise. The author is in no way liable for this software's performance
  210. or any damage it may cause to any data of any kind anywhere.
  211. ***************************************************************************
  212.  
  213. SHAR_EOF
  214. if test 8177 -ne "`wc -c < 'README'`"
  215. then
  216.     echo shar: error transmitting "'README'" '(should have been 8177 characters)'
  217. fi
  218. fi
  219. echo shar: extracting "'domains'" '(1093 characters)'
  220. if test -f 'domains'
  221. then
  222.     echo shar: will not over-write existing file "'domains'"
  223. else
  224. cat << \SHAR_EOF > 'domains'
  225. #
  226. # Domain Table
  227. #
  228. # Format: <domain>,<prefix>,<suffix>,<template>
  229. #
  230. # Where <template> may contain:
  231. #       %P - prefix string
  232. #       %S - suffix string
  233. #       %U - destination user name
  234. #       %N - destination site name
  235. #       %D - destination site name with domain suffix
  236. #       %% - a percent (%) sign
  237. #       %R - pathalias route to the destination site
  238. #
  239. .WA.UUCP,,,%R!%U
  240. .OR.UUCP,,,%R!%U
  241. .N-CA.UUCP,,,%R!%U
  242. .S-CA.UUCP,,,%R!%U
  243. .MTN.UUCP,,,%R!%U
  244. .S-CEN.UUCP,,,%R!%U
  245. .MID-W.UUCP,,,%R!%U
  246. .S-EAST.UUCP,,,%R!%U
  247. .ATL.UUCP,,,%R!%U
  248. .N-ENG.UUCP,,,%R!%U
  249. .HI.UUCP,,,%R!%U
  250. .W-CAN.UUCP,,,%R!%U
  251. .E-CAN.UUCP,,,%R!%U
  252. .EUR.UUCP,,,%R!%U
  253. .UK.UUCP,,,%R!%U
  254. .AUS.UUCP,,,%R!%U
  255. .ISRAEL.UUCP,,,%R!%U
  256. .ATT.UUCP,>ihnp4,,%P!%D!%U
  257. .HP.UUCP,,,%R!%U
  258. .PE.UUCP,,,%R!%U
  259. .UUCP,,,%R!%U
  260. .CSNET,>rice,,%P!%U%%%D@CSNET-RELAY.ARPA
  261. .MAILNET,>rice,,%P!%U%%%D@MULTICS.MIT.EDU
  262. # .BITNET,>rice,,%P!%U%%%D@WISCVM.ARPA
  263. .XEROX,>rice,,%P!%U.%D@XEROX.ARPA
  264. .DEC,>decwrl,,%P!%U@%D
  265. .ARPA,>rice,,%P!%U@%D
  266. .EDU,>rice,,%P!%U@%D
  267. .COM,>rice,,%P!%U@%D
  268. .GOV,>rice,,%P!%U@%D
  269. .MIL,>rice,,%P!%U@%D
  270. .OTH,>rice,,%P!%U@%D
  271. .BITNET,>psuvax,,%P!%U@%D
  272. SHAR_EOF
  273. if test 1093 -ne "`wc -c < 'domains'`"
  274. then
  275.     echo shar: error transmitting "'domains'" '(should have been 1093 characters)'
  276. fi
  277. fi
  278. echo shar: extracting "'palias'" '(151 characters)'
  279. if test -f 'palias'
  280. then
  281.     echo shar: will not over-write existing file "'palias'"
  282. else
  283. cat << \SHAR_EOF > 'palias'
  284. baylor baylor!%s
  285. decwrl shell!ihnp4!decwrl!%s
  286. ihnp4 shell!ihnp4!%s
  287. kitty baylor!kitty!%s
  288. neuro1 %s
  289. psuvax shell!psuvax!%s
  290. rice  rice!%s
  291. shell shell!%s
  292. SHAR_EOF
  293. if test 151 -ne "`wc -c < 'palias'`"
  294. then
  295.     echo shar: error transmitting "'palias'" '(should have been 151 characters)'
  296. fi
  297. fi
  298. echo shar: extracting "'rmail.c'" '(3533 characters)'
  299. if test -f 'rmail.c'
  300. then
  301.     echo shar: will not over-write existing file "'rmail.c'"
  302. else
  303. cat << \SHAR_EOF > 'rmail.c'
  304. #ifndef lint
  305. static char rcsid[]="$Header: rmail.c,v 3.0 86/03/14 12:04:54 sob RELEASE_3 $";
  306.  
  307. #endif
  308.  
  309. /*
  310. **  RMAIL -- UUCP mail server.
  311. **
  312. **    This program reads the >From ... remote from ... lines that
  313. **    UUCP is so fond of and turns them into something reasonable.
  314. **    It calls uumail giving it a -f option built from these
  315. **    lines.
  316. ***************************************************************************
  317. This work in its current form is Copyright 1986 Stan Barber
  318. with the exception of opath, gethostname and the original getpath which
  319. as far as I know are in the Public Domain. This software may be distributed
  320. freely as long as no profit is made from such distribution and this notice
  321. is reproducted in whole.
  322. ***************************************************************************
  323. This software is provided on an "as is" basis with no guarantee of 
  324. usefulness or correctness of operation for any purpose, intended or
  325. otherwise. The author is in no way liable for this software's performance
  326. or any damage it may cause to any data of any kind anywhere.
  327. ***************************************************************************
  328. */
  329.  
  330. #define _DEFINE
  331.  
  332. #include "uuconf.h"
  333. extern FILE *popen();
  334. extern char *index();
  335. extern char *rindex();
  336.  
  337. # define MAILER    "/usr/lib/uucp/uumail"
  338.  
  339. main(argc, argv)
  340.     char **argv;
  341. {
  342.     FILE *out;    /* output to mail handler */
  343.     char lbuf[512];    /* one line of the message */
  344.     char from[512];    /* accumulated path of sender */
  345.     char ufrom[64];    /* user on remote system */
  346.     char sys[64];    /* a system in path */
  347.     char junk[512];    /* scratchpad */
  348.     char cmd[2000];
  349.     register char *cp;
  350.     register char *uf;    /* ptr into ufrom */
  351.     int i;
  352.  
  353. # ifdef DEBUG
  354.     if (argc > 1 && strcmp(argv[1], "-T") == 0)
  355.     {
  356.         Debug = TRUE;
  357.         argc--;
  358.         argv++;
  359.     }
  360. # endif DEBUG
  361.  
  362.     if (argc < 2)
  363.     {
  364.         fprintf(stderr, "Usage: rmail user ...\n");
  365.         exit(EX_USAGE);
  366.     }
  367.  
  368.     (void) strcpy(from, "");
  369.     (void) strcpy(ufrom, "/dev/null");
  370.     uf = NULL;
  371.  
  372.     for (;;)
  373.     {
  374.         (void) fgets(lbuf, sizeof lbuf, stdin);
  375.         if (strncmp(lbuf, "From ", 5) != 0 && strncmp(lbuf, ">From ", 6) != 0)
  376.             break;
  377.         (void) sscanf(lbuf, "%s %s", junk, ufrom);
  378.         cp = lbuf;
  379.         uf = ufrom;
  380.         for (;;)
  381.         {
  382.             cp = index(cp+1, 'r');
  383.             if (cp == NULL)
  384.             {
  385.                 register char *p = rindex(uf, '!');
  386.  
  387.                 if (p != NULL)
  388.                 {
  389.                     *p = '\0';
  390.                     if (uf != NULL) 
  391.                         (void) strcpy(sys, uf);
  392.                     else
  393.                         gethostname(sys,32);
  394.                     uf = p + 1;
  395.                     break;
  396.                 }
  397.                 cp = "remote from somewhere";
  398.             }
  399. #ifdef DEBUG
  400.             if (Debug)
  401.                 printf("cp='%s'\n", cp);
  402. #endif
  403.             if (strncmp(cp, "remote from ", 12)==0)
  404.                 break;
  405.         }
  406.         if (cp != NULL)
  407.             (void) sscanf(cp, "remote from %s", sys);
  408.         (void) strcat(from, sys);
  409.         (void) strcat(from, "!");
  410. #ifdef DEBUG
  411.         if (Debug)
  412.             printf("ufrom='%s', sys='%s', from now '%s'\n", uf, sys, from);
  413. #endif
  414.     }
  415.     if (uf != NULL)
  416.         (void) strcat(from, uf);
  417.  
  418. /*    (void) sprintf(cmd, "exec %s -em -f%s", MAILER, from);*/
  419.     if (from[0] == '\0')
  420.         (void) sprintf(cmd, "exec %s", MAILER);
  421.     else
  422.         (void) sprintf(cmd, "exec %s -f%s", MAILER, from);
  423.     while (*++argv != NULL)
  424.     {
  425.         (void) strcat(cmd, " '");
  426.         if (**argv == '(')
  427.             (void) strncat(cmd, *argv + 1, strlen(*argv) - 2);
  428.         else
  429.             (void) strcat(cmd, *argv);
  430.         (void) strcat(cmd, "'");
  431.     }
  432. #ifdef DEBUG
  433.     if (Debug)
  434.         printf("cmd='%s'\n", cmd);
  435. #endif
  436.     out = popen(cmd, "w");
  437.     fputs(lbuf, out);
  438.     while (fgets(lbuf, sizeof lbuf, stdin))
  439.         fputs(lbuf, out);
  440.     i = pclose(out);
  441.     if ((i & 0377) != 0)
  442.     {
  443.         fprintf(stderr, "pclose: status 0%o\n", i);
  444.         exit(EX_OSERR);
  445.     }
  446.  
  447.     exit((i >> 8) & 0377);
  448. }
  449. SHAR_EOF
  450. if test 3533 -ne "`wc -c < 'rmail.c'`"
  451. then
  452.     echo shar: error transmitting "'rmail.c'" '(should have been 3533 characters)'
  453. fi
  454. fi
  455. echo shar: extracting "'address.c'" '(1228 characters)'
  456. if test -f 'address.c'
  457. then
  458.     echo shar: will not over-write existing file "'address.c'"
  459. else
  460. cat << \SHAR_EOF > 'address.c'
  461. /*
  462.  * address - run opath to see what a translated RFC822 address will come
  463.  * out as.
  464.  *
  465.  * By E. Roskos 1/16/85
  466.  * $Log:    address.c,v $
  467.  * Revision 3.0  86/03/14  12:04:19  sob
  468.  * Release of 3/15/86 --- 3rd Release
  469.  * 
  470.  * Revision 1.4  85/12/26  15:47:45  sob
  471.  * Added modifications suggested by terry%owl@rand-unix.ARPA
  472.  * 
  473.  * Revision 1.3  85/11/24  14:50:01  sob
  474.  * Added corrections provided by regina!mark
  475.  * 
  476.  * Revision 1.2  85/09/16  18:31:53  sob
  477.  * Added DEBUG flag
  478.  * 
  479.  * Revision 1.1  85/09/16  17:50:24  sob
  480.  * Initial revision
  481.  * 
  482.  */
  483. #define _DEFINE
  484. #include "uuconf.h"
  485.  
  486. static char rcsid[] = "$Header: address.c,v 3.0 86/03/14 12:04:19 sob RELEASE_3 $";
  487.  
  488. EXTERN char *paths;
  489. char *opath(), *oupath();
  490. int Debug;
  491.  
  492. main(argc,argv)
  493. int argc;
  494. char **argv;
  495. {
  496. char *p;
  497. int uswitch;
  498.  
  499. paths = DATABASE;
  500. ConfFile=CONFIGFILE;
  501.  
  502.     if (argc < 2)
  503.     {
  504.         fprintf(stderr,"usage: %s rfcaddress [...]\n",
  505.             argv[0]);
  506.         exit(1);
  507.     }
  508.  
  509.     while (--argc)
  510.     {
  511.         p = *++argv;
  512.         if (*p=='-')
  513.         {
  514.             switch(*++p)
  515.             {
  516.             case 'u': uswitch++;
  517.                   continue;
  518.             case 'd': Debug++;
  519.                       continue;
  520.             default:  printf("unknown switch: %c\n",*p);
  521.                   continue;
  522.             }
  523.         }
  524.         printf("%s: %s\n",p,uswitch?oupath(p):opath(p));
  525.     }
  526.  
  527.     exit(0);
  528. }
  529. SHAR_EOF
  530. if test 1228 -ne "`wc -c < 'address.c'`"
  531. then
  532.     echo shar: error transmitting "'address.c'" '(should have been 1228 characters)'
  533. fi
  534. fi
  535. echo shar: extracting "'makefile'" '(3095 characters)'
  536. if test -f 'makefile'
  537. then
  538.     echo shar: will not over-write existing file "'makefile'"
  539. else
  540. cat << \SHAR_EOF > 'makefile'
  541. ####################################################################
  542. # makefile for uumail & uupath
  543. # program to integrate with pathalias created uucpmap databases
  544. # programs originally developed by Jeff Donnelly
  545. # updated to use pathalias database by Stan Barber
  546. # $Header: makefile,v 1.5 86/02/26 03:33:10 sob Exp $
  547. #***************************************************************************
  548. # This work in its current form is Copyright 1986 Stan Barber
  549. # with the exception of opath, gethostname and the original getpath which
  550. # as far as I know are in the Public Domain. This software may be distributed
  551. # freely as long as no profit is made from such distribution and this notice
  552. # is reproducted in whole.
  553. # ***************************************************************************
  554. ###############################################################
  555. .SUFFIXES: .c,v .h,v
  556.  
  557.  
  558.  
  559. LIBS=
  560.  
  561. BINDIR=/usr/lbin
  562.  
  563. UUCPDIR=/usr/lib/uucp
  564.  
  565. LIBDIR=/usr/lib
  566.  
  567. UUMAIL=$(UUCPDIR)/uumail
  568.  
  569. REALUUX=/usr/bin/uux
  570.  
  571. OPTIONS=  -DOPATH -DSYSIII -DDEBUG -DUGLYUUCP -DLOG -DSORTED 
  572.  
  573. CFLAGS= -O -DUUMAIL='"$(UUMAIL)"' -DREALUUX='"$(REALUUX)"' $(OPTIONS)
  574.  
  575. SHELL=/bin/sh
  576. DIST1=README domains palias rmail.c
  577. DIST2= opath.c uumail.c uuconf.h gethostnam.c getpath.c alias.c
  578. DIST3= address.c makefile uux.c
  579. DIST4= uumail.1  opath.3 address.1 Alias.Design Sendmail Binary.Only
  580.  
  581. DIST= $(DIST1) $(DIST2) $(DIST3) $(DIST4)
  582.  
  583.  
  584. .c,v.c:
  585.     co -q $*.c
  586.  
  587. .h,v.h:
  588.     co -q $*.h
  589.  
  590. all: uumail rmail address uux
  591.  
  592. uumail: getpath.o uumail.o gethostnam.o opath.o alias.o
  593.     cc $(CFLAGS) getpath.o uumail.o gethostnam.o opath.o alias.o  -o uumail $(LIBS)
  594.  
  595. address:address.o opath.o getpath.o
  596.     cc $(CFLAGS) address.o opath.o getpath.o -o address $(LIBS)
  597.  
  598. uux: uux.o
  599.     cc $(CFLAGS) uux.o -o $@ $(LIBS)
  600.  
  601. getpath.o: getpath.c uuconf.h
  602.  
  603. uupath.o: uupath.c uuconf.h
  604.  
  605. uumail.o: uumail.c uuconf.h
  606.  
  607. gethostnam.o:gethostnam.c
  608.  
  609. address.o:address.c
  610.  
  611. opath.o:opath.c
  612.  
  613. alias.o:alias.c
  614.  
  615. aliascheck.o:aliascheck.c
  616.  
  617. rmail: rmail.c gethostnam.o
  618.     cc $(CFLAGS) rmail.c gethostnam.o -o rmail $(LIBS)
  619.  
  620. install: uumail address domains palias
  621.     cp address $(BINDIR)
  622.     cp uumail $(UUCPDIR)
  623.     if [ ! -r $(UUCPDIR)/domains ]; then cp domains $(UUCPDIR); fi
  624.     if [ ! -r $(UUCPDIR)/palias ]; then cp palias $(UUCPDIR); fi
  625.     @echo "To install rmail in place of the current rmail, type"
  626.     @echo "make mailer"
  627.     @echo "To intercept uux commands, you need to be sure"
  628.     @echo "that you correctly specified REALUUX in makefile"
  629.     @echo "Then type make fakeuux"
  630.     ln $(UUCPDIR)/uumail $(BINDIR)/uupath
  631.  
  632. mailer: rmail
  633.     make install
  634.     rm -rf /bin/rmail
  635.     cp rmail /bin/rmail
  636.     
  637. fakeuux: uux
  638.     make install
  639.     cp /usr/bin/uux $(REALUUX)
  640.     cp uux /usr/bin/uux
  641.     chmod 6755 /usr/bin/uux
  642.  
  643. lint:
  644.     lint $(CFLAGS) getpath.c uumail.c gethostnam.c opath.c alias.c
  645.  
  646. clean: 
  647.     rm -f *.o uumail address rmail uux
  648.  
  649. doc: uumail.1 uupath.1 address.1 opath.3
  650.     nroff -man uumail.1 >uumail.cat; nroff -man uupath.1 >uupath.cat; nroff -man address.1 >address.cat; nroff -man opath.3 >opath.cat
  651.  
  652. shar: $(DIST)
  653.     shar -v $(DIST1) > dist1.out;shar -v $(DIST2)> dist2.out;shar -v $(DIST3) > dist3.out;shar -v $(DIST4) > dist4.out
  654.  
  655.  
  656. SHAR_EOF
  657. if test 3095 -ne "`wc -c < 'makefile'`"
  658. then
  659.     echo shar: error transmitting "'makefile'" '(should have been 3095 characters)'
  660. fi
  661. fi
  662. echo shar: extracting "'uux.c'" '(3649 characters)'
  663. if test -f 'uux.c'
  664. then
  665.     echo shar: will not over-write existing file "'uux.c'"
  666. else
  667. cat << \SHAR_EOF > 'uux.c'
  668. /*
  669.  * a "fake" uux to replace the realone to allow uumail to intercept
  670.  * mail at sites that mail not be able to recompile their mailers
  671.  * Called via "uux - system!rmail user" from, normally, /bin/mail.
  672. ***************************************************************************
  673. This work in its current form is Copyright 1986 Stan Barber
  674. with the exception of opath, gethostname and the original getpath which
  675. as far as I know are in the Public Domain. This software may be distributed
  676. freely as long as no profit is made from such distribution and this notice
  677. is reproducted in whole.
  678. ***************************************************************************
  679. This software is provided on an "as is" basis with no guarantee of 
  680. usefulness or correctness of operation for any purpose, intended or
  681. otherwise. The author is in no way liable for this software's performance
  682. or any damage it may cause to any data of any kind anywhere.
  683. ***************************************************************************
  684.  * $Log:    uux.c,v $
  685.  * Revision 3.0  86/03/14  12:05:06  sob
  686.  * Release of 3/15/86 --- 3rd Release
  687.  * 
  688.  * Revision 1.6  86/03/14  11:57:51  sob
  689.  * 
  690.  * 
  691.  * Revision 1.5  86/03/11  11:29:17  sob
  692.  * Added Copyright Notice
  693.  * 
  694.  * Revision 1.4  86/02/17  18:07:48  sob
  695.  * Moved REALUUX and UUMAIL definitions to the makefile
  696.  * 
  697.  * Revision 1.3  86/02/17  17:58:15  sob
  698.  * Small syntax problem
  699.  * 
  700.  * Revision 1.2  86/02/17  17:55:45  sob
  701.  * Corrected to remove parens from destbuf.
  702.  * 
  703.  * Revision 1.1  86/02/17  17:45:10  sob
  704.  * Initial revision
  705.  * 
  706.  *
  707.  */
  708.  
  709. #define _DEFINE
  710.  
  711. #include "uuconf.h"
  712. static char rcsid[] = "$Header: uux.c,v 3.0 86/03/14 12:05:06 sob RELEASE_3 $";
  713.  
  714. extern FILE *popen();
  715. extern char *index();
  716. extern struct passwd *getpwnam();
  717.  
  718. char sysbuf[BUFSIZ];
  719. char destbuf[BUFSIZ];
  720.  
  721. main(argc, argv)
  722. int argc;
  723. char **argv;
  724. {
  725.     char *command;
  726.     struct passwd *pwd;
  727.     char cmd[BUFSIZ];
  728.     char *system = sysbuf;
  729.     char **psystem = &system;
  730.     FILE *netf;
  731.     int c;
  732.  
  733.     if ((argc != 4) || strcmp("-", argv[1]))  /* look for form 
  734.                             of uux command */
  735.         realuux(argv);    
  736.  
  737.     strcpy(sysbuf, argv[2]);    /* save destination system */
  738.  
  739.     if ((command = index(sysbuf, '!')) == NULL)
  740.         realuux(argv);     
  741.     *command++ = 0;
  742.     if (strcmp("rmail", command))    /* look for rmail in command */
  743.         realuux(argv);        
  744.  
  745.     mystrcpy(destbuf, argv[3]);      /*save destination path */
  746.                     /* but get rid of parens */
  747.     /* become UUCP */
  748.     setpwent();
  749.     pwd = getpwnam("uucp");
  750.     if (pwd == NULL) {
  751.         fprintf(stderr, "Can't suid to \"uucp\" in %s\n", REALUUX);
  752.         exit(1);    /* sigh */
  753.     }
  754.     endpwent();
  755.     setuid(pwd->pw_uid);
  756.  
  757.     /* send the mail to uumail */
  758.     sprintf(cmd, "uumail %s!%s", UUMAIL, sysbuf,destbuf);
  759.     if ((netf = popen(cmd, "w")) == NULL)
  760.         exit(EX_TEMPFAIL);    /* failure */
  761.  
  762.     /* send the actual mail */
  763.     while ((c = getchar()) != EOF)
  764.         putc(c, netf);
  765.     fflush(netf);
  766.     exit (pclose(netf)?1:0);    /* causes mail to do the right thing */
  767. }
  768.  
  769. realuux(argv)
  770. char **argv;
  771. {
  772.     int pid, sts;
  773.  
  774.     /* running suid root.  become us again */
  775.     setuid(getuid());
  776.  
  777.         if ((pid = fork()) == -1) {
  778.                 fprintf(stderr, "uux: can't create proc for %s\n",REALUUX);
  779.                 exit(1);
  780.         }
  781.         if (pid) {
  782.                 while (wait(&sts) != pid) {
  783.                         if (wait(&sts)==-1)
  784.                                 exit(1);
  785.                 }
  786.                 exit(sts?1:0);
  787.         }
  788.     execv(REALUUX, argv);
  789.     fprintf(stderr, "uux: can't exec %s\n",REALUUX);
  790.     exit (1);
  791. }
  792.  
  793. /* remove parens for t and put what's left in s */
  794. mystrcpy(s,t)
  795. char * s, *t;
  796. {
  797.     int x;
  798.     while (x = *t++){
  799.         if ((x == '(') || (x == ')'))
  800.             continue;
  801.         *s++ = x;
  802.     }
  803.     
  804.     *s = x;
  805. }
  806. SHAR_EOF
  807. if test 3649 -ne "`wc -c < 'uux.c'`"
  808. then
  809.     echo shar: error transmitting "'uux.c'" '(should have been 3649 characters)'
  810. fi
  811. fi
  812. echo shar: extracting "'uumail.1'" '(2865 characters)'
  813. if test -f 'uumail.1'
  814. then
  815.     echo shar: will not over-write existing file "'uumail.1'"
  816. else
  817. cat << \SHAR_EOF > 'uumail.1'
  818. .TH "UUMAIL" "8" "Baylor College of Medicine"
  819. .fi
  820. .ad b
  821. .SH NAME
  822. uumail \- rewrite address & route mail using uucpmap database 
  823. .br
  824. uupath \- print the uucp path to a host
  825. .SH SYNOPSIS
  826. .B uumail [ \fIoptions\fR ] \fIaddress\fR
  827. .br
  828. .B uupath \fIhostname\fR
  829. .SH DESCRIPTION
  830. .B Uumail
  831. is designed to be used as a mail delivery program to correctly
  832. route mail over uucp connections.
  833. .SS Standard Options
  834. .IP "-f\fIaddress\fR" 16
  835. The
  836. .I -f
  837. option sets the address of the sender of the mail. If this flag 
  838. is not used, the sender will be established by usings environmental variables
  839. (like 
  840. .B LOGNAME
  841. and
  842. .B USER
  843. ) or using getlogin(3).
  844. .IP "-C\fIconfigfile\fR" 16
  845. The
  846. .I -C
  847. option allows an alternative configuration file to be specified.
  848. .IP "-om" 16
  849. The
  850. .I -om
  851. option causes the mail to also be sent to the sender of the message.
  852. .IP "-oc" 16
  853. The 
  854. .I  -oc
  855. option causes
  856. .B uucico 
  857. to be started immediately after queuing the mail.
  858. The default just queues the mail.
  859. .IP "-h" 16
  860. The -h option causes no From_ line to be added to the beginning of file.
  861. This is useful when uumail is being used as a mailer for sendmail(8).
  862. .SS Compile-time Configurable Options
  863. .IP "-d[1-6]" 16
  864. The
  865. .I -d 
  866. option turns on the limited debugging facility built into the
  867. mailer.  In debug mode, the mailer does not actually mail anything, but
  868. tells you what it would do if it did do it. The level of debugging can
  869. be set by following the 
  870. .I -d
  871. flag with a number between 1 and 6.
  872. .IP "-g[A-Z]" 16
  873. If your 
  874. .B uux(1)
  875. supports grading of transactions, the
  876. .I -g 
  877. option can be used to set the
  878. grade of this mail. A grade of \fIC\fR is used by default.
  879. .IP "-n" 16
  880. The
  881. .I -n
  882. option will prohibit the use of infomation provided by the system alias
  883. file. Information in users'
  884. .I .forward
  885. files will still be utilized if present.
  886.  
  887. .SS Arguments
  888. .IP \fIhost!user\fR 16
  889. where host is a system node name on the network and user is the login
  890. name of the addressee.
  891. .IP \fIuser@host.domain\fR
  892. same as above with the addition of a domain specifier like
  893. .B .ARPA, .GOV, .COM, .EDU
  894. etc.
  895. .SH FILES
  896. .IP "/usr/lib/uucp/Aliases" 20
  897. System-wide alias file
  898. .IP ".forward" 20
  899. Individual user's mail forwarding file
  900. .IP "/usr/lib/uucp/palias{.pag|.dir}" 20
  901. Path file produced by pathalias.
  902. .IP "/usr/lib/uucp/uucp/domains" 20
  903. Domain rewriting rules for opath(3).
  904. .IP "/usr/adm/uumail.log" 20
  905. Log of uumail activity.
  906. .SH "SEE ALSO"
  907. pathalias(1), address(1), mh(1), opath(3), sendmail(8), uux(1)
  908. .br
  909. .B RFC 822 "Standard for the Format of ARPA Internet Text Messages"
  910. .br
  911. .B RFC 976 "UUCP Mail Interchange Format Standard"
  912.  
  913. .SH AUTHORS
  914. .br
  915. Stan Barber, Baylor College of Medicine
  916. .br
  917. Getpath routine by John Donnelly, University of Illinois
  918. .br
  919. Gethostname routine by Peter Honeyman, Princeton
  920. .br
  921. Opath routine by Eric Roskos, CONCURRENT Computers
  922. .br
  923. Aliasing scheme borrowed from the MH mail handling system
  924.  
  925. SHAR_EOF
  926. if test 2865 -ne "`wc -c < 'uumail.1'`"
  927. then
  928.     echo shar: error transmitting "'uumail.1'" '(should have been 2865 characters)'
  929. fi
  930. fi
  931. echo shar: extracting "'opath.3'" '(5023 characters)'
  932. if test -f 'opath.3'
  933. then
  934.     echo shar: will not over-write existing file "'opath.3'"
  935. else
  936. cat << \SHAR_EOF > 'opath.3'
  937. .TH OPATH 3 local
  938. .SH NAME
  939. opath - Generate a UUCP route from an RFC822/RFC976 address
  940. .br
  941. oupath - Generate a UUCP route from a (possibly disconnected) UUCP path
  942. .SH SYNOPSIS
  943. char *opath(s)
  944. .br
  945. char *s;
  946. .sp 1
  947. char *oupath(s)
  948. .br
  949. char *s;
  950. .SH DESCRIPTION
  951. These routines use the \fBpathalias\fR database to generate UUCP routing
  952. paths from your local site to specified remote sites on either the UUCP
  953. network or other connected networks.
  954. .PP
  955. \fBopath\fR takes one argument, an RFC822/RFC976 address, as described in
  956. ADDRESS(1).  From this, it generates and returns a UUCP path to the site
  957. named in the argument.
  958. .PP
  959. \fBoupath\fR takes one argument, a UUCP path.  If the next site on this
  960. path is named \fIx\fR, \fBoupath\fR will prepend a path from your site to
  961. \fIx\fR, if \fIx\fR is nonadjacent to your site.  If \fIx\fR is a domain,
  962. i.e. contains a dot (.), \fBoupath\fR will generate a path to a gateway
  963. for this domain.  Note that \fBoupath\fR will \fInot\fR alter the argument
  964. path, other than to make the above transformations; it does not check whether
  965. sites in the argument are adjacent to one another, or whether they represent
  966. an optimal path; it is assumed that if the user has specified a path, then
  967. he wants to use that path.
  968. .PP
  969. The principal difference between \fBopath\fR and \fBoupath\fR is that the
  970. former gives precedence to ``@'', whereas the latter gives precedence
  971. to ``!''.  The former is intended to be invoked when receiving mail from
  972. a user interface or a non-UUCP source (if the subsequent transport mechanism
  973. is to be UUCP), whereas the latter is intended solely to be used by UUCP
  974. internal software, principally \fBrmail\fR, in routing mail through the
  975. UUCP network.
  976. .SH "FILES"
  977. \fI/usr/lib/uucp/palias\fR - The pathalias database.
  978. See PATHALIAS(1) for information; pathalias is a public-domain program
  979. distributed via the Usenet's net.sources facility.
  980. .br
  981. .sp 1
  982. \fI/usr/lib/uucp/domains\fR - The domain/gateway table.  Each line of this
  983. file consists of either a ``#'' followed by arbitrary comment text, or
  984. an entry of the form:
  985. .br
  986. .in 1i
  987. <domain>,<path>,<reserved>,<template>
  988. .br
  989. .in
  990. Where <domain> is the string (in capital letters) identifying a particular
  991. <path> is a string which may be included at an arbitrary point in the
  992. generated route, <reserved> is currently unused, and <template> is a string
  993. indicating the format of the generated route.
  994. .PP
  995. The <template> is a printf-style string; it is \fBnot\fR quoted, and
  996. begins at the character immediately following the comma which separates
  997. <template> from <reserved>.  The <template> may consist of arbitrary ASCII
  998. characters, which are copied unchanged into the generated route; or of
  999. a percent (%) sign followed by one of the following characters:
  1000. .IP P
  1001. The <path> string is inserted.  The <path> may consist either of a string
  1002. which is inserted unchanged; or of the character ``>'' followed by the
  1003. name of a UUCP site, in which case the entire <path> string is replaced
  1004. with a string representing the path to the named site.  The last token on
  1005. this string is the site named in the original <path> string, without a
  1006. following ``!''.
  1007. .IP U
  1008. The user name from the original address is inserted.
  1009. .IP N
  1010. The site name from the original address, with the domain specifiers
  1011. removed, is inserted.
  1012. .IP D
  1013. The site name from the original address, including the domain specifiers,
  1014. is inserted.
  1015. .IP R
  1016. The UUCP path to the site named in the original address is looked up in
  1017. the pathalias database and inserted.  Note that this path is looked up
  1018. only when the %R is seen while scanning the <template>, so an error message
  1019. for an invalid site name is generated if and only if it appears in an
  1020. address with a domain which contains a %R in its template.
  1021. .PP
  1022. When making entries in the domain table, domain names which are a suffix of
  1023. another domain name in the table should be ordered such that the longer
  1024. string(s) appear first.  For example, .WA.UUCP should preceed .UUCP in
  1025. the table.  A linear search is made of the table, and the first domain
  1026. found in the table which is a suffix of the domain in the designated address
  1027. is used as the domain in generating the routing.
  1028. .PP
  1029. Following are some example entries for the domain table.  Note that all
  1030. domain names begin with a ``.''.
  1031. .sp 1
  1032. .nf
  1033. .in 1i
  1034. # This is a comment
  1035. \&.HP.UUCP,,,%R!%U
  1036. \&.UUCP,,,%R!%U
  1037. \&.CSNET,>decwrl,,%P!%U%%%S@CSNET-RELAY.ARPA
  1038. \&.EDU,>ucbvax,,%P!%D
  1039. .in
  1040. .fi
  1041. .sp 1
  1042. .SH "SEE ALSO"
  1043. pathalias(1), address(1), rmail(1), uumail(8)
  1044. .br
  1045. .B RFC 822 "Standard for the Format of ARPA Internet Text Messages"
  1046. .br
  1047. .B RFC 976 "UUCP Mail Interchange Format Standard"
  1048. .SH "AUTHOR"
  1049. Eric Roskos, CONCURRENT COMPUTERS
  1050. .SH "NOTE"
  1051. The <reserved> field in the domain table currently has a function which
  1052. may be determined by examining the source code for opath.  However, this
  1053. function is a vestigal function provided for sites that used an earlier
  1054. version of opath; future opath versions will use this field for a different
  1055. purpose, and new users of opath therefore should \fBnot\fR use this field.
  1056. SHAR_EOF
  1057. if test 5023 -ne "`wc -c < 'opath.3'`"
  1058. then
  1059.     echo shar: error transmitting "'opath.3'" '(should have been 5023 characters)'
  1060. fi
  1061. fi
  1062. echo shar: extracting "'address.1'" '(3735 characters)'
  1063. if test -f 'address.1'
  1064. then
  1065.     echo shar: will not over-write existing file "'address.1'"
  1066. else
  1067. cat << \SHAR_EOF > 'address.1'
  1068. .TH ADDRESS 1 local
  1069. .SH NAME
  1070. address - display the path generated by \fBuumail\fR for an
  1071. RFC822/RFC976-format address.
  1072. .SH SYNOPSIS
  1073. address rfc-address [ ... ]
  1074. .SH DESCRIPTION
  1075. This program allows you to check the UUCP mail routing path that will
  1076. be generated by the UUCP mailer \fBuumail\fR if you specify an
  1077. RFC822/RFC976-format address \fBrfc-address\fR in the ``To:'' field of the mail header.
  1078. For each RFC-style address on the command line, \fBaddress\fR echoes the
  1079. address to the standard output, followed by a colon, followed by
  1080. the UUCP address that will be used to send the message to that address.
  1081.  
  1082. .SH "ADDRESS FORMAT"
  1083. Briefly, the RFC822/RFC976-format address is of the form
  1084. .nf
  1085. .sp 1
  1086.     <localaddress>@<hostname>.<network>
  1087. .sp 1
  1088. .fi
  1089. where <hostname> is the name of the system you are sending the message
  1090. to, <network> is a modifier for <hostname> identifying the network in
  1091. which the address is to be interpreted (UUCP, ARPA, MAILNET, CSNET, etc);
  1092. and <localaddress> is an address string to be interpreted on the host
  1093. machine.
  1094.  
  1095. The <localaddress> field may contain further remote addresses to be
  1096. interpreted on the host machine.  Typically this will be an address for
  1097. mailing via another network; and in particular, the <localaddress> may
  1098. (recursively) be identical in format to the RFC address, but with
  1099. the symbol `%' replacing the symbol `@' in the standard address format.
  1100. Where this form is used, the rightmost % is replaced by an
  1101. @ before the host machine sends the message out.
  1102.  
  1103. On our system, the presently
  1104. valid <network>s are UUCP, ARPA, CSNET, and MAILNET.
  1105. The recently proposed UUCP domain names are also accepted, although
  1106. they are treated the same as plain ``UUCP''.
  1107. Omitting
  1108. the <network> causes the network to default to UUCP.  The <hostname>
  1109. should be the name of a remote machine to which the message is
  1110. directed; see \fI/usr/lib/uucp/uuaddress.alpha\fR for a list of all
  1111. known UUCP hostnames.  It is \fInot\fR necessary to specify a UUCP pathname
  1112. when using this format; the pathname is automatically determined for you
  1113. and substituted into the address before mailing.  The selected pathname
  1114. is determined using the \fBpathalias\fR database, and is supposed
  1115. to be optimal, taking into consideration information provided by
  1116. each site about how often they send mail out, etc.
  1117.  
  1118. .SH EXAMPLES
  1119. .HP 5
  1120. joe
  1121. .br
  1122. The message is sent to the user ``joe'' on the local system.
  1123. .HP 5
  1124. joe@ucbvax
  1125. .br
  1126. The message is sent to joe on the UUCP system named ``ucbvax''; this
  1127. address is automatically translated to a proper (and ostensibly
  1128. optimal) UUCP path.
  1129. .HP 5
  1130. joe@ucbvax.UUCP
  1131. .br
  1132. Same as joe@ucbvax
  1133. .HP 5
  1134. joe@ucbvax.ARPA
  1135. .br
  1136. The message is addressed to joe at ucbvax, using the ARPA network.
  1137. The message will be routed to the ARPAnet via a UUCP-ARPAnet gateway.
  1138. .HP 5
  1139. joe%mit-multics.ARPA@ucbvax
  1140. .br
  1141. The message is sent to ucbvax, who then uses the address
  1142. joe@mit-multics.ARPA to send the message on to mit-multics via the
  1143. ARPAnet.  Since ucbvax is on the arpanet, this address will work correctly
  1144. (as long as there is someone named joe on the MIT multics machine).
  1145. .HP 5
  1146. joe%vanderbilt.MAILNET%mit-multics.ARPA@ucbvax
  1147. .br
  1148. The message is sent via UUCP to ucbvax, who then sends the message
  1149. to mit-multics via the arpanet; mit-multics then sends the message
  1150. to joe@vanderbilt via MAILNET.  Since the above machines each have access
  1151. to the networks named in the address, this address will work correctly.
  1152. .SH FILES
  1153. /usr/lib/uucp/domains - Domain/gateway table
  1154. .br
  1155. /usr/lib/uucp/palias - Pathalias database
  1156. .SH "SEE ALSO"
  1157. opath(3), uupath(1), uumail(8)
  1158. .br
  1159. .B RFC 822 "Standard for the Format of ARPA Internet Text Messages"
  1160. .br
  1161. .B RFC 976 "UUCP Mail Interchange Format Standard"
  1162. .SH AUTHOR
  1163. Eric Roskos, CONCURRENT COMPUTERS
  1164. SHAR_EOF
  1165. if test 3735 -ne "`wc -c < 'address.1'`"
  1166. then
  1167.     echo shar: error transmitting "'address.1'" '(should have been 3735 characters)'
  1168. fi
  1169. fi
  1170. echo shar: extracting "'Alias.Design'" '(2472 characters)'
  1171. if test -f 'Alias.Design'
  1172. then
  1173.     echo shar: will not over-write existing file "'Alias.Design'"
  1174. else
  1175. cat << \SHAR_EOF > 'Alias.Design'
  1176. This is the format for the Alias file used in uumail. It is derived from
  1177. the Rand Mail Handler system (MH).
  1178. Stan Barber 02/15/86
  1179. ***************************************************************************
  1180. This work in its current form is Copyright 1986 Stan Barber
  1181. with the exception of opath, gethostname and the original getpath which
  1182. as far as I know are in the Public Domain. This software may be distributed
  1183. freely as long as no profit is made from such distribution and this notice
  1184. is reproducted in whole.
  1185. ***************************************************************************
  1186.  
  1187. The Alias file for mail delivery is the file
  1188.  
  1189.     /usr/lib/uucp/Aliases
  1190.  
  1191. Each line of the alias file has the format:
  1192.  
  1193. match : alias
  1194.  
  1195. Where:
  1196.  
  1197.     alias       :=  simple-list
  1198.             |   "<" alias-file
  1199.             |   "=" UNIX-group
  1200.             |   "|" program-name
  1201.  
  1202.     simple-list :=  simple-name
  1203.             |   simple-list, simple-name
  1204.  
  1205. Alias-file and program-name are fully qualified UNIX file names.
  1206. UNIX-group is a group name from /etc/group.  A simple-name is a 
  1207. local user login name, including only alphanumerics, `.' and `-'. 
  1208. Throughout this file case is ignored, except for alias-file and
  1209. program-name.
  1210.  
  1211. In match, a trailing * on a name will match anything. (See example
  1212. below.)
  1213.  
  1214. The procedure for mail aliasing is:
  1215.  
  1216. 1) Build a list of all addresses from the message to be
  1217.    delivered, eliminating duplicates.
  1218.  
  1219. 2) For each line in the alias file, compare "match" against all
  1220.    of the existing addresses.  If a match, remove the matched
  1221.    name from the address list, and add each new alias name to the
  1222.    address list if it is not already on the list.
  1223.  
  1224. 3) If output from uumail is to be sent to some other program, the pipe
  1225.    ("|") alias will cause output to be directly sent to that program instead
  1226.    of via mail.
  1227.  
  1228. Since the alias file is read line by line, forward references
  1229. work, but backward references are not recognized, thus, there is
  1230. no recursion.
  1231.  
  1232. E.g.:
  1233.  
  1234. Borden: bruce
  1235. Bruce: bsb
  1236. Wharman: mike
  1237. ASRL: bsb, mike, obrien, giarla
  1238. UNIX-committee: < /usr/people/unix-committee
  1239. System: = sys
  1240. rnews: | /usr/lib/news/recnews
  1241.    ...
  1242.  
  1243. In the "unix-committee" example, the file "/usr/people/unix-
  1244. committee" contains one simple-name, or a list of comma separated
  1245. simple-names.  A new-line will be treated as a blank in this
  1246. file, s.a.
  1247.  
  1248.     foo, fie,
  1249.     fum, fiddle
  1250.  
  1251. In the "system" case, the names from the group "sys" will be used
  1252. as the expanded name list.
  1253.  
  1254. Originally by
  1255. Bruce Borden    October 1979
  1256. SHAR_EOF
  1257. if test 2472 -ne "`wc -c < 'Alias.Design'`"
  1258. then
  1259.     echo shar: error transmitting "'Alias.Design'" '(should have been 2472 characters)'
  1260. fi
  1261. fi
  1262. echo shar: extracting "'Sendmail'" '(1535 characters)'
  1263. if test -f 'Sendmail'
  1264. then
  1265.     echo shar: will not over-write existing file "'Sendmail'"
  1266. else
  1267. cat << \SHAR_EOF > 'Sendmail'
  1268. ***************************************************************************
  1269. This work in its current form is Copyright 1986 Stan Barber
  1270. with the exception of opath, gethostname and the original getpath which
  1271. as far as I know are in the Public Domain. This software may be distributed
  1272. freely as long as no profit is made from such distribution and this notice
  1273. is reproducted in whole.
  1274. ***************************************************************************
  1275.  
  1276. What I recommend for sendmail users is to use the following as the OPTIONS
  1277. in the makefile:
  1278.  
  1279. OPTIONS= -DGETHOSTNAME -DNOALIAS
  1280. You may want to add either -DSORTED or -DDBM.
  1281.  
  1282.  
  1283. Then edit the mailer definition for uucp in /usr/lib/sendmail.cf
  1284. and change the P=/usr/bin/uux to be P=[where uumail is] (e.g.
  1285. /usr/lib/uucp/uumail).
  1286. Change the A= to A=uumail -h -f$g $h!$u
  1287.  
  1288. This will replace the uux execution with uumail. If you do this exactly, 
  1289. you will only need the pathalias generated database to be present for
  1290. uumail to work correctly. If you add -DOPATH to the OPTIONS line, you
  1291. will need the domains file (/usr/lib/uucp/domains) correctly configured
  1292. for your site. See opath.3 for more information.
  1293.  
  1294. There are more things you can do to make sendmail be smarter about
  1295. using uumail, but in general, this is not necessary since uumail
  1296. will return informative messges to sendmail ( and the user) if 
  1297. there is a failure.
  1298.  
  1299. If you would like to share your problems or ideas on interfacing
  1300. sendmail and uumail, I would appreciate hearing them.
  1301.  
  1302. Thanks.
  1303. Stan Barber
  1304. 15 March 1986
  1305.  
  1306.  
  1307. SHAR_EOF
  1308. if test 1535 -ne "`wc -c < 'Sendmail'`"
  1309. then
  1310.     echo shar: error transmitting "'Sendmail'" '(should have been 1535 characters)'
  1311. fi
  1312. fi
  1313. echo shar: extracting "'Binary.Only'" '(980 characters)'
  1314. if test -f 'Binary.Only'
  1315. then
  1316.     echo shar: will not over-write existing file "'Binary.Only'"
  1317. else
  1318. cat << \SHAR_EOF > 'Binary.Only'
  1319. Unfortunately, you may not be able to alter your mail programs to utilize
  1320. the features of uumail. 
  1321.  
  1322. However, I am providing a method for you to try experimentally. Please
  1323. let me know if it works successfully for you.
  1324.  
  1325. Mail usually works like this----
  1326.  
  1327. mail --->Is it local? -->Yes-->put in mail box
  1328.         |
  1329.         No
  1330.         |
  1331.         --> uux --> uucp to destination machine
  1332.  
  1333. What I am providing is a program that you put in place of uux to 
  1334. call uumail to route the mail for you. Then the map becomes---
  1335.  
  1336. mail --->Is it local? -->Yes-->put in mail box
  1337.         |
  1338.         No
  1339.         |
  1340.         --> fakeuux --> Is it rmail? --> No --> realuux -->uucp
  1341.                     |
  1342.                     Yes
  1343.                     |
  1344.                     --> uumail --> realuux --> uucp
  1345.  
  1346.  
  1347. Basically, you put the old uux in another place and put this fake uux in
  1348. the original location. To try this feature, edit makefile and change the
  1349. definition of REALUUX to match the place you will put your ORIGINAL uux
  1350. program. Then type
  1351. make fakeuux
  1352.  
  1353. Good luck and let me know if it works.
  1354. Stan Barber
  1355. Feb 25, 1986
  1356. SHAR_EOF
  1357. if test 980 -ne "`wc -c < 'Binary.Only'`"
  1358. then
  1359.     echo shar: error transmitting "'Binary.Only'" '(should have been 980 characters)'
  1360. fi
  1361. fi
  1362. exit 0
  1363. #    End of shell archive
  1364.